import { useStore } from '@/store'

export function usePermission(pageName: string, btnName: string) {
  const store = useStore()
  const permissions = store.state.login.permissions

  // 随便适配下
  // pageName = pageName === 'user' ? 'users' : pageName

  const verifyPermission = `system:${pageName}:${btnName}`
  return !!permissions.find((item: any) => item === verifyPermission)
}
